package source

import (
	"time"
)

// DataSourceConfig 数据源配置模型
type DataSourceConfig struct {
	ID                      int       `json:"id" gorm:"column:id;primaryKey;autoIncrement"`
	SourceName              string    `json:"source_name" gorm:"column:source_name;uniqueIndex;not null"`
	SourceType              string    `json:"source_type" gorm:"column:source_type;not null"`
	DataType                string    `json:"data_type" gorm:"column:data_type;not null"`
	TargetMongoDBDB         string    `json:"target_mongodb_db" gorm:"column:target_mongodb_db;not null"`
	TargetMongoDBCollection string    `json:"target_mongodb_collection" gorm:"column:target_mongodb_collection;not null"`
	TargetESIndex           string    `json:"target_es_index" gorm:"column:target_es_index;not null"`
	TargetMinioBucket       string    `json:"target_minio_bucket" gorm:"column:target_minio_bucket;not null"`
	ProcessingRules         string    `json:"processing_rules" gorm:"column:processing_rules;type:json"`
	IsActive                bool      `json:"is_active" gorm:"column:is_active;default:true"`
	CreatedAt               time.Time `json:"created_at" gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
	UpdatedAt               time.Time `json:"updated_at" gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
}

// TableName 指定表名
func (DataSourceConfig) TableName() string {
	return "data_source_configs"
}
